package com.isoft.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.xml.bind.annotation.*;
import lombok.Data;

import java.util.List;

@Data
@XmlRootElement(name = "MSG")
@XmlAccessorType(XmlAccessType.FIELD)
public class DfoeDfieEntity {
    @JsonProperty("meta")
    @XmlElement(name = "META")
    private Meta meta;

    @JsonProperty("dflt")
    @XmlElement(name = "DFLT")
    private Dflt dflt;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Meta {
        @XmlElement(name = "SNDR")
        private String sender;
        @XmlElement(name = "RCVR")
        private String receiver;
        @XmlElement(name = "SEQN")
        private Long sequenceNumber;
        @XmlElement(name = "DDTM")
        private String dateTime;
        @XmlElement(name = "TYPE")
        private String type;
        @XmlElement(name = "STYP")
        private String subType;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Dflt {
        @XmlElement(name = "FLID")
        private Long flightId;
        @XmlElement(name = "AFID")
        private String alternateFlightId;
        @XmlElement(name = "FFID")
        private String flightFileId;
        @XmlElement(name = "FIDE")
        private String flightIdentifier;
        @XmlElement(name = "TEST")
        private String testFlag;
        @XmlElement(name = "AWCD")
        private String airlineCode;
        @XmlElement(name = "FLNO")
        private String flightNumber;
        @XmlElement(name = "FEXD")
        private String flightExecutionDate;
        @XmlElement(name = "FIMD")
        private String flightImplementationDate;
        @XmlElement(name = "FLIO")
        private String flightDirection;
        @XmlElement(name = "FLTK")
        private String flightTicketInfo;
        @XmlElement(name = "FATT")
        private String flightAttribute;
        @XmlElement(name = "PATT")
        private String previousAttribute;
        @XmlElement(name = "CFTP")
        private String aircraftType;
        @XmlElement(name = "CFNO")
        private String aircraftNumber;
        @XmlElement(name = "STAT")
        private String status;
        @XmlElement(name = "ABST")
        private String abnormalStatus;
        @XmlElement(name = "ABRS")
        private String abnormalReason;
        @XmlElement(name = "ISTA")
        private String internalStatus;
        @XmlElement(name = "IAST")
        private String internalAbnormalStatus;
        @XmlElement(name = "IARS")
        private String internalAbnormalReason;
        @XmlElement(name = "MSTA")
        private String manualStatus;
        @XmlElement(name = "MABS")
        private String manualAbnormalStatus;
        @XmlElement(name = "MABR")
        private String manualAbnormalReason;
        @XmlElement(name = "MIST")
        private String manualInternalStatus;
        @XmlElement(name = "MIAS")
        private String manualInternalAbnormalStatus;
        @XmlElement(name = "MIAR")
        private String manualInternalAbnormalReason;
        @XmlElement(name = "BORT")
        private String boardingTime;
        @XmlElement(name = "MBOR")
        private String manualBoardingTime;
        @XmlElement(name = "TBRT")
        private String timeBoardingTime;
        @XmlElement(name = "MTBR")
        private String manualTimeBoardingTime;
        @XmlElement(name = "LBDT")
        private String lastBaggageTime;
        @XmlElement(name = "MLBD")
        private String manualLastBaggageTime;
        @XmlElement(name = "POKT")
        private String pokTime;
        @XmlElement(name = "MPOK")
        private String manualPokTime;
        @XmlElement(name = "APOT")
        private String apotTime;
        @XmlElement(name = "DETT")
        private String detTime;
        @XmlElement(name = "DRTT")
        private String drtTime;
        @XmlElement(name = "DELT")
        private String delTime;
        @XmlElement(name = "DRLT")
        private String drlTime;
        @XmlElement(name = "VIP")
        private Integer vipCount;
        @XmlElement(name = "SFLG")
        private String sharedFlag;
        @XmlElement(name = "PAST")
        private String pastTime;
        @XmlElement(name = "AIRL")
        private Airl airl;
        @XmlElement(name = "GTLS")
        private String gtls;
        @XmlElement(name = "BLLS")
        private String blls;
        @XmlElement(name = "CKLS")
        private Ckls ckls;
        @XmlElement(name = "CHLS")
        private String chls;
        @XmlElement(name = "STLS")
        private String stls;
        @XmlElement(name = "TMCD")
        private Tmcd tmcd;
        @XmlElement(name = "FLDT")
        private String fldt;
        @XmlElement(name = "LLDT")
        private String lldt;
        @XmlElement(name = "CONT")
        private Integer cont;
        @XmlElement(name = "PROX")
        private Integer prox;

        @Data
        @XmlAccessorType(XmlAccessType.FIELD)
        public static class Airl {
            @XmlElement(name = "ARPT")
            private List<Arpt> arpts;

            @Data
            @XmlAccessorType(XmlAccessType.FIELD)
            public static class Arpt {
                @XmlElement(name = "APNO")
                private Integer airportSeq;
                @XmlElement(name = "APCD")
                private String airportCode;
                @XmlElement(name = "FPTT")
                private String scheduledTime;
                @XmlElement(name = "FETT")
                private String estimatedTime;
                @XmlElement(name = "FRTT")
                private String actualTime;
                @XmlElement(name = "APAT")
                private String airportTerminal;
            }
        }

        @Data
        @XmlAccessorType(XmlAccessType.FIELD)
        public static class Ckls {
            @XmlElement(name = "FCES")
            private String fces;
            @XmlElement(name = "FCEE")
            private String fcee;
            @XmlElement(name = "FCRS")
            private String fcrs;
            @XmlElement(name = "FCRE")
            private String fcre;
            @XmlElement(name = "MCES")
            private String mces;
            @XmlElement(name = "MCEE")
            private String mcee;
            @XmlElement(name = "MCRS")
            private String mcrs;
            @XmlElement(name = "MCRE")
            private String mcre;
            @XmlElement(name = "FCDP")
            private String fcdp;
            @XmlElement(name = "MCDP")
            private String mcdp;
        }

        @Data
        @XmlAccessorType(XmlAccessType.FIELD)
        public static class Tmcd {
            @XmlElement(name = "NMCD")
            private String gateNumber;
            @XmlElement(name = "JMCD")
            private String jointGateNumber;
        }
    }

    public Meta getMeta() {
        return meta;
    }

    public void setMeta(Meta meta) {
        this.meta = meta;
    }

    public Dflt getDflt() {
        return dflt;
    }

    public void setDflt(Dflt dflt) {
        this.dflt = dflt;
    }
}